#ifndef PFS_THREAD_POOL_H
#define PFS_THREAD_POOL_H
#include "Thread.h"
#include <vector>
#include "Lock.h"
#include "config.h"
#include <stdint.h>

using namespace std;
namespace PFS
{
    class ThreadPool
    {
        public:
            ThreadPool(thread_fun func);
            ThreadPool(int init_num, thread_fun func);
            virtual ~ThreadPool();
            void stop();
            void set_task(Job* job, void *data);
            int get_thread_num()
            { return init_num; }

        private:
            void init_data(int num, thread_fun fun);
            vector<EventThread *> thread_list;
            int init_num;
            thread_fun func;
            volatile uint64_t used;
    };
}
#endif
